import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MapDemo {
    public static void main(String[] args) {
        Map<String,String> map = new HashMap<String,String>();
        map.put("1000","Jack");
        map.put("1001","Amy");
        map.put("1002","Andy");
        map.put("1002","July");  //当不是第一次添加相同键的键值对时，可以实现对值的修改
        System.out.println(map);
        map.remove("1001");  //删除键为 1001 的键值对
        System.out.println(map);
        System.out.println(map.size());
        System.out.println(map.get("1000"));
        Collection<String>col =map.keySet();
        for(String s : col)
            System.out.print(s + " ");
            System.out.println();
        Collection<String> values = map.values();
        for(String s : values)
            System.out.print(s + " ");
            System.out.println();



    }
}
